import * as log4js from 'log4js'
import application from '@/config/application.ts'
import mysql from '@/config/mysql.ts'

log4js.configure({
  appenders: {
    stdout: {
      type: 'console'
    },
    ExpApplication: {
      ...application.log4j
    },
    MySql: {
      ...mysql.log4j
    }
  },
  categories: {
    ExpApplication: {
      appenders: ['stdout', 'ExpApplication'], level: 'all'
    },
    MySql: {
      appenders: ['stdout', 'MySql'], level: 'all'
    },
    default: {
      appenders: ['stdout'], level: 'all'
    }
  }
})

export const AppLogger = log4js.getLogger('ExpApplication')

export const MySqlLogger = log4js.getLogger('MySql')
